package com.etoak.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class User {

    /**
     * 用户id
     */

    private Integer id;

    /**
     * 用户名
     */
    @NotBlank(message = "必填")
    @Length(min = 2, max = 12, message = "长度为2-12字符")
    private String name;

    private String password;

    /***
     * 用户邮箱
     */
    @NotBlank(message = "必填")
    @Email(message = "格式错误")
    private String email;

    /**
     * 年龄
     */
    @NotNull(message = "必填")
    @Min(value = 1, message = "最小1岁")
    private Integer age;

    /**
     * 状态
     */
    private Integer state;

    /**
     * 访问量
     */
    private Long visit;

    /**
     * 金钱
     */
    private Integer money;

    /**
     * 创建时间
     */
    private String createTime;


}
